package com.develop.skwen.basemodule;

import android.app.Application;
import android.content.Context;

import java.io.File;

/**
 * Created by skwen
 * on 18-5-29
 */

public class App extends Application {

    private static Context mContext;

    private static File cacheDirectory;

    @Override
    public void onCreate() {
        super.onCreate();
        this.mContext = this.getApplicationContext();
        init();
    }

    private void init() {
        //新建一个文件用来缓存网络请求
        cacheDirectory = new File(App.getContext()
                .getCacheDir().getAbsolutePath(), "HttpCache");
    }

    public static Context getContext(){
        return mContext;
    }

    public static File cacheDirectory(){
        return cacheDirectory;
    }
}
